package com.cc.wechat.common;

import lombok.Getter;

/**
 * API 响应码枚举
 */
@Getter
public enum ResultCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    
    // 用户相关错误
    USER_NOT_FOUND(1001, "用户不存在"),
    USERNAME_ALREADY_EXISTS(1002, "用户名已存在"),
    EMAIL_ALREADY_EXISTS(1003, "邮箱已被注册"),
    PASSWORD_ERROR(1004, "密码错误"),
    
    // 好友相关错误
    FRIEND_REQUEST_ALREADY_SENT(2001, "好友请求已发送"),
    FRIEND_ALREADY_EXISTS(2002, "已经是好友关系"),
    FRIEND_REQUEST_NOT_FOUND(2003, "好友请求不存在"),
    FRIEND_NOT_EXISTS(2004, "好友不存在"),
    
    // 群组相关错误
    GROUP_NOT_FOUND(3001, "群组不存在"),
    GROUP_ALREADY_EXISTS(3002, "群组已存在"),
    NOT_GROUP_MEMBER(3003, "不是群组成员"),
    GROUP_MEMBER_LIMIT(3004, "群组成员已达上限"),
    
    // 消息相关错误
    MESSAGE_SEND_FAILED(4001, "消息发送失败"),
    MESSAGE_NOT_FOUND(4002, "消息不存在"),
    MESSAGE_DELETE_FAILED(4003, "消息删除失败"),

    // 文件相关错误
    FILE_UPLOAD_FAILED(5001, "文件上传失败"),
    FILE_DELETE_FAILED(5002, "文件删除失败"),
    FILE_NOT_FOUND(5003, "文件不存在"),
    FILE_SIZE_EXCEEDED(5004, "文件大小超出限制"),
    FILE_TYPE_NOT_ALLOWED(5005, "文件类型不允许"),
    FILE_URL_GENERATE_FAILED(5006, "文件URL生成失败"),
                    
    // 会话相关错误
    SESSION_NOT_FOUND(6001, "会话不存在"),
    
   

    /**
     * 操作失败
     */
    OPERATION_FAILED(5000, "操作失败");

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
} 